package cn.techfan.customerrestservice;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.Random;

@RestController
public class CustomerRestController {

    @RequestMapping("/user/{id}")
    public Mono<User> getUser(@PathVariable String id) {

        return Mono.just(new User(id, "Michael", (new Random()).nextInt(100)));
    }
}
